#ifndef ENTITY_H_
#define ENTITY_H_

#include "geom.h"
#include <boost/shared_ptr.hpp>

class Scene;

class Entity  {
public:
    Entity(void);
    Entity(boost::shared_ptr<Scene> scene);
    virtual ~Entity(void);

    void prepare(float dt);
    void render(void) const;
    void postRender(void);
    bool initialize(void);
    void shutdown(void);
    bool canBeRemoved(void) const;
    void destroy(void);

    void setPosition(const Vector3& v) { m_position = v; }
    Vector3 getPosition() const { return m_position; }

    void setRotationAngles(const Vector3& v) { m_rotationAngles = v; }
    Vector3 getRotationAngles(void) const { return m_rotationAngles; }

    void applyRotation(void) const;

    boost::shared_ptr<Scene> getScene() const { return m_scene; }

    virtual void setPixelsSize(const Dimension& size) { m_pixelsSize = size; }

    bool isOutOfScreen(void) const;

protected:
    bool m_canBeRemoved;
    boost::shared_ptr<Scene> m_scene;
    Vector3 m_position;
    Vector3 m_rotationAngles;
    Dimension m_pixelsSize;

private:
    virtual void onPrepare(float dt) = 0;
    virtual void onRender(void) const = 0;
    virtual void onPostRender(void) = 0;
    virtual bool onInitialize(void) = 0;
    virtual void onShutdown(void) = 0;
    virtual void onDestroy(void) = 0;

};

#endif // ENTITY_H_
